package com.example.springboot.Service;

import com.example.springboot.entity.Course_select;
import com.example.springboot.mapper.Course_selectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class Course_selectService {

    @Autowired
    private Course_selectMapper course_selectMapper;
    public int saveCouese_Select(Course_select course_select) {
        if (course_select.getCourse_select_id() == null ){
            try{
                return course_selectMapper.insert(course_select);
            }catch (Exception e){
                return -100;
            }
        }else {
            try {
                return course_selectMapper.update(course_select);
            }
            catch (Exception e){
                return -100;
            }
        }
    }
}
